package com.yyfax.pay.third.model.to.fuiou;

import com.yyfax.framework.model.Params;
import com.yyfax.framework.yyfax.enums.RspCodeEnum;
import com.yyfax.pay.common.exception.YYPayException;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

/**
*  独立鉴权-直连，富有请求报文
* @author xulqb
* @date 2017-12-21 15:14:01
* @param 
* @return
* @since V1.0.0
*/
@SuppressWarnings({ "serial" })
public class WithoutVerifyFuiouParams extends Params {

	/**
	 * 获取验证码URL
	 */
	private String url;

	/**
	 * 请求参数
	 */
	private Map<String, String> params;

	/**
	 * 请求报文
	 */
	private String reqBody;

	private String merchantSecurit;

	private String userId;

	public String getMerchantSecurit() {
		return merchantSecurit;
	}

	public void setMerchantSecurit(String merchantSecurit) {
		this.merchantSecurit = merchantSecurit;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Map<String, String> getParams() {
		return params;
	}

	public void setParams(Map<String, String> params) {
		this.params = params;
	}

	public String getReqBody() {
		return reqBody;
	}

	public void setReqBody(String reqBody) {
		this.reqBody = reqBody;
	}

	@Override
	public boolean validate() throws Exception {

		if (StringUtils.isBlank(url)) {
			throw new YYPayException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "url参数不能为空");
		}

		if (this.params == null) {
			throw new YYPayException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "params参数不能为空");
		}
		return false;
	}


}
